Repository navigation
feat(rust): make Rust a full language with generator config, publishable crates and the rules gate - #627
Merged
Conversation
…s no machine path, crates ready to publish B1: the project's generator list is metaobjects.config.json (cargo meta init writes it, gen --list shows configured against available); no eject needed to drop a generator. B2: eject names the exact crates.io release by default and takes --engine for a checkout or git revision; the crates drop publish = false, gain packaging metadata, and the rust lane runs cargo publish --dry-run. ADR-0065 Amendment 3 records it. Nothing is published.
…, held to rules-check-conformance
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Changed
cargo metagains a generator config and a portable eject.cargo meta initwrites{ "generators": [...] }intometaobjects.config.json, so a project drops a generator by config instead of ejecting.cargo meta gen --listreports each generator as configured or not, using the newgenerator_list.rsand a registry fixture update.cargo meta ejectno longer writes the build machine's path intocodegen/Cargo.toml. The owned crate pins the crates.io release by default, and--engine <directory | git-url[#rev]>points it at a checkout or git revision.cargo meta verifynow runs the business-rules gate (ADR-0066). The newmetaobjects::rules_checkmodule reports the same five findings, severities and message text as the other ports. It honours the fourrules.*settings andverify.lifecycle.unreachable. The newrules_check_conformancetest runs it againstfixtures/rules-check-conformance/, andvalidate/rules.rsand the conformance ledger were adjusted to match.publish = falseis removed. Each crate gains packaging metadata, a README and a LICENSE. Therustlane inscripts/ci-local.shnow runscargo publish --dry-run --workspace --locked; nothing is published. ADR-0065 Amendment 3, CHANGELOG,docs/ports/rust.md, CONFORMANCE, the stability labels and the fit-assessment skill docs are updated to describe Rust as a full port.Validation
Risk Assessment
✅ Low: The Rust lane work is well-bounded: crate packaging metadata, a strict generator-list parser, an engine-source abstraction for eject, and a rules gate ported from the reference. The only issue found is stale preview wording in an ADR. The rules gate is covered by the shared conformance corpus, but this pass did not run any tests.
Testing
I built the CLI and drove it in a disposable project. Bare
verifyran the rules gate and exited 0 on a clean model. On theunreachable-state-errorfixture it printed the two expected errors and exited 1.verify --codegenskipped the rules gate, so the review-4 concern is not present in the current code. Generator selection, eject, undo, listing and unknown-generator refusal all behaved correctly. The rules-check conformance test also passed. Two limits: ejected-crate builds could not run because the engine crate is not on crates.io, and I wrote no source or test files, so I did not re-run broad regression.cargo meta verifyruns the business-rules gate: a clean model exits 0 with a rules summary, and an unreachable-state model atunreachable: errorreports 2 errors and exits 1;--codegenskip…metaobjects.config.json:initscaffolds it,gen --listreports configured generators, and an unknown generator name is refused bygen--undoremoves the copy, and an unknown generator is rejectedEvidence: init transcript
Evidence: verify rules gate transcript
Evidence: rules conformance test
Evidence: generators and eject transcript
Evidence: unknown generator transcript
Pipeline
Updates from git push no-mistakes
✅ **Intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
server/rust/metaobjects-cli/src/lib.rs:75- Stale help text after this change.verify --codegenhelp still says "It is the only gate this port ships, so a bareverifyruns it", and the--templatesrefusal says "verify --codegenis the gate it ships." A bareverifynow also runs the business-rules gate, and docs/ports/rust.md was updated to say so. Reword both strings, e.g. "the generated-code gate; a bareverifyruns it and the business-rules gate".docs/ports/rust.md:3- docs/ports/rust.md still opens "Rust port (preview)" and says "in preview" at lines 1, 3, 253, 265, 299 and 385. ADR-0065 Amendment 3 and the CHANGELOG now describe Rust as a full, publishable language in 1.3.0, so the page contradicts them. The cross-language-porting rule file also still says "Rust in preview". If preview status is deliberately kept until the first publish, no action is needed. Otherwise the wording should be reconciled.🔧 Fix applied.
4 infos still open:
server/rust/metaobjects-cli/src/lib.rs:75- Stale help text after this change.verify --codegenhelp still says "It is the only gate this port ships, so a bareverifyruns it", and the--templatesrefusal says "verify --codegenis the gate it ships." A bareverifynow also runs the business-rules gate, and docs/ports/rust.md was updated to say so. Reword both strings, e.g. "the generated-code gate; a bareverifyruns it and the business-rules gate".docs/CONFORMANCE.md:94- Fix round left a stale sentence: "The column joins this table when the port leaves preview." The same round removed the preview label (ADR-0065 Amendment 4), so the condition no longer names anything. docs/ports/rust.md:299 was reworded to the tautology "joins when the port has a column". Both should state a real condition, e.g. when the port runs the render, persistence and API-contract corpora. Same class: docs/features/stability-labels.md:45 still says "A port's preview status is on its page"; and the new Rust row at line 26 uses "supported", which is not one of the three labels the page defines (stable, preview, experimental, lines 10-14), so the row has no defined meaning.CHANGELOG.md:421- The [1.3.0] section (starts line 79) still labels the Rust port "in preview" at lines 410, 421, 430, 441, 449, 478, 490 and 520. Line 430 describes the unlisted-failure warning as applying "while the port is in preview", which Amendment 4 reframes as "until the owner turns the warning off". A reader of the 1.3.0 notes gets a Rust port that is both preview and a full language. Unreleased entries can be reworded; line 1432 is a released section and should stay. agent-context/ capability-sheet.md:66 and SKILL.md:335 also still say preview, left deliberately (golden regen rule).server/rust/metaobjects-cli/src/lib.rs:591-cmd_verifynever reads--codegen, soverify --codegenalso runs the business-rules gate and exits 1 on a rules error. The help text and docs/ports/rust.md say a bareverifyruns it and the generated-code gate, which implies--codegenalone is codegen-only (as in the TS reference). An adopter CI step pinned toverify --codegenwill now fail on averify.lifecycle.unreachable: errororrules.permissions.names: requirefinding. Either gate the rules lines/exit code on--codegenbeing absent, or reword help and docs to say both gates always run. The remedy decides product behavior, so it needs the author's choice. The earlier help-text rewording round did not cover this sibling.🔧 Fix applied.
📝 4 wording or comment-placement notes left for the author (no fix round spent):
CHANGELOG.md:421- The [1.3.0] section (starts line 79) still labels the Rust port "in preview" at lines 410, 421, 430, 441, 449, 478, 490 and 520. Line 430 describes the unlisted-failure warning as applying "while the port is in preview", which Amendment 4 reframes as "until the owner turns the warning off". A reader of the 1.3.0 notes gets a Rust port that is both preview and a full language. Unreleased entries can be reworded; line 1432 is a released section and should stay. agent-context/ capability-sheet.md:66 and SKILL.md:335 also still say preview, left deliberately (golden regen rule).scripts/ci-local.sh:72- Stale 'preview' wording about the Rust port survives the preview cleanup. scripts/ci-local.sh:72 says 'rust → the Rust port (preview): cargo fmt ...' and scripts/ci-lane-map.txt:44 says 'the Rust port (preview, ADR-0065)'. ADR-0065 Amendment 4 retired the label and the intent is 'Rust as a full language'. The earlier fix round grepped only docs/, spec/ and agent-context/, so scripts/ was left behind. Reword both comments (ci-lane-map.txt is outside the listed changed files but is the same class). Comment-only, no behavior change.CHANGELOG.md:410- The 1.3.0 entry still says of the Rust port 'It has noverify, so the rules gate does not run there.' The same changelog now sayscargo meta verifyexists (line ~487verify --codegen) and, in the new Amendment 3 entry (line ~75), that it runs the business-rules gate. The sentence contradicts the release notes. Reword to say the rules gate runs incargo meta verify(see the Amendment 3 entry) or drop the sentence.spec/decisions/ADR-0065-rust-is-the-sixth-port.md:138- Stale preview wording left after the Amendment 4 cleanup. Owner ruling 2 still says the engine's Rust API "carries no stability promise while the port is in preview". Line 107 still says the CONFORMANCE.md column is deferred "until it leaves preview". Both contradict Amendment 4, which retires the label. eject.rs's doc comment was already reworded to "between releases", so ruling 2 should match. Reword line 138 to "between releases". Give line 107 a real condition, e.g. until the port runs the render, persistence and API-contract corpora.✅ **Test** - passed
✅ No issues found.
cargo meta verifyruns the business-rules gate: a clean model exits 0 with a rules summary, and an unreachable-state model atunreachable: errorreports 2 errors and exits 1;--codegenskip…metaobjects.config.json:initscaffolds it,gen --listreports configured generators, and an unknown generator name is refused bygen--undoremoves the copy, and an unknown generator is rejectedscripts/ci-local.sh --affected --strict-toolchainsBaseline:scripts/ci-local.sh --affected --strict-toolchainspassed (ran before this step, not re-run)cargo build -p metaobjects-cli, then drovecargo-meta meta init|gen|verify|ejectin a throwaway project built fromfixtures/rules-check-conformancecasescargo test -p metaobjects --test rules_check_conformancecargo meta gen --list,eject --list,eject entity, repeat eject,eject --undo, unknown generator inmetaobjects.config.json🔧 **Document** - 1 issue found → auto-fixed ✅
agent-context/skills/metaobjects-fit-assessment/references/capability-sheet.md:66- The capability sheet and SKILL.md:335 still call Rust "a sixth port in preview, unpublished". They are left as is on purpose: an earlier round recorded that they are golden-regenerated. Reword them in the next golden regen. Also still saying preview: the notes string in server/rust/metaobjects/tests/conformance-expected-failures.json, and the $comment in fixtures/generator-registry-conformance/registry.json. Both are test data or a canonical manifest, so I did not touch them.🔧 Fix applied.
✅ Re-checked - no issues remain.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.